#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
  char bar[101];
  memset(bar,'\0', sizeof(bar));
  char* lable = "|/-\\";
  int i = 0;
  while (i <= 100)
  {
    printf("[%-100s][%3d%][%c]\r", bar, i, lable[i%4]);
    fflush(stdout);
    usleep(50000);
    bar[i] = '#';
    ++i;
  }
  printf("\n");
  return  0;
}
